from tools.dbo import get_server_data


def get_unit(conn):
    id_unit = get_server_data(conn, "id,label", "label='单位'", "bims_dict")
    if len(id_unit) != 1:
        print("请先设置单位数据！")
        return

    dict_unit = get_server_data(conn, "id,label", "p_id=" + str(id_unit[0][0]), "bims_dict")
    return dict_unit